package com.jinxiangyang.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jinxiangyang.domain.Notice;
import com.jinxiangyang.domain.vo.NoticeVo;
import com.jinxiangyang.mapper.NoticeMapper;
import com.jinxiangyang.service.NoticeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 通知表 服务实现类
 * </p>
 *
 * @author jinxiangyang
 * @since 2023-08-12
 */
@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {

    @Autowired
    private NoticeMapper noticeMapper;


    @Override
    public Map<String, Object> selectNoticeAll(Integer pageNumber,Integer pageSize,Notice notice){

        Page<Notice> page = new Page<>(pageNumber,pageSize);
        List<Notice> noticeList = noticeMapper.findLikeNoticeBy(page,notice);
        HashMap<String, Object> result = new HashMap<>();
        result.put("page",page);
        result.put("noticeList",noticeList);
        return result;
    }

    @Override
    public Boolean updateNoticeById(Notice notice) {
        return noticeMapper.updateNoticeById(notice);
    }


}
